import Vue from 'vue'
import VueRouter from 'vue-router'
/*导入路径*/
import Home from '../views/main/index.vue'
import LOGIN from '../views/login/index.vue'
import Brand from '../views/brand/index.vue'

Vue.use(VueRouter)

const routes = [
    //路由跳转  首页
    {
        path: '/',
        name: 'Main',
        component: Home,
        redirect:'/login',//默认/ 跳转路径
        //子页面品牌
        children: [
            //初始路由
            {
                path: '/index',
                name: 'Index',
                component: () => import( '../views/index/index.vue')
            },

            {
                path: '/brand',
                name: 'Brand',
                component: Brand,
            },
            {
                path: '/category',
                name: 'Category',
                component: () => import( '../views/category/index.vue')
            },
            {
                path: '/good',
                name: 'Good',
                component: () => import( '../views/good/index.vue')
            },
            {
                path: '/admin',
                name: 'Admin',
                component: () => import( '../views/admin/index.vue')
            },
            {
                path: '/dept',
                name: 'Dept',
                component: () => import( '../views/dept/index.vue')
            },
            {
                path: '/role',
                name: 'Role',
                component: () => import( '../views/role/index.vue')
            },
            {
                path: '/menu',
                name: 'Menu',
                component: () => import( '../views/menu/index.vue')
            },
            {
                path: '/market',
                name: 'Market',
                component: () => import( '../views/market/index.vue')
            },
            {
                path: '/webmarket',
                name: 'Webmarket',
                component: () => import( '../views/webmarket/index.vue')
            },
            {
                path: '/outwarehouse',
                name: 'Outwarehousearket',
                component: () => import( '../views/outwarehouse/index.vue')
            },
            {
                path: '/inputwarehouseMarket',
                name: 'InputwarehouseMarket',
                component: () => import( '../views/inputwarehouseMarket/index.vue')
            },
            {
                path: '/indentMarket',
                name: 'IndentMarket',
                component: () => import( '../views/indentMarket/index.vue')
            },
            {
                path: '/total_market',
                name: 'Total_market',
                component: () => import( '../views/total_market/index.vue')
            },
            {
                path: '/returnMarket',
                name: 'ReturnMarket',
                component: () => import( '../views/returnMarket/index.vue')
            },
            {
                path: '/addIndent',
                name: 'AddIndent',
                component: () => import( '../views/addIndent/index.vue')
            },
            {
                path: '/inputwarehouse',
                name: 'Inputwarehouse',
                component: () => import( '../views/inputwarehouse/index.vue')
            },

            //库存管理模块
            {
                path: '/aftersale-out-depot',
                name: 'Aftersale-out-depot',
                component: () => import( '../views/aftersale-out-depot/index.vue')
            },
            {
                path: '/sale-out-depot',
                name: 'Sale-out-depot',
                component: () => import( '../views/sale-out-depot/index.vue')
            },
            {
                path: '/total_market',
                name: 'Total_market',
                component: () => import( '../views/total_market/index.vue')
            },{
                path: '/returnMarket',
                name: 'ReturnMarket',
                component: () => import( '../views/returnMarket/index.vue')
            },
            {
                path: '/addIndent',
                name: 'AddIndent',
                component: () => import( '../views/addIndent/index.vue')
            },
            {
                path: '/aftersale-enter-depot',
                name: 'Aftersale-enter-depot',
                component: () => import( '../views/aftersale-enter-depot/index.vue')
            },
            //售后入库详情路由
            {
                path: '/aftersale-enter-depot-detail',
                name: 'Aftersale-enter-depot-detail',
                component: () => import( '../views/aftersale-enter-depot-detail/index.vue')
            },
            {
                path: '/sale-enter-depot',
                name: 'Sale-enter-depot',
                component: () => import( '../views/sale-enter-depot/index.vue')
            },
            {
                path: '/sale-out-depot-detail',
                name: 'Sale-out-depot-detail',
                component: () => import( '../views/sale-out-depot-detail/index.vue')
            },
            {
                path: '/sale-out-depot-operate',
                name: 'Sale-out-depot-operate',
                component: () => import( '../views/sale-out-depot-operate/index.vue')
            },


            //商品与赠品管理模块
            {
                path: '/goods',
                name: 'goods',
                component: () => import( '../views/goodsAndGifts/goods/index.vue')
            },
            {
                path: '/product',
                name: 'product',
                component: () => import( '../views/goodsAndGifts/product/index.vue')
            },
            {
                path: '/baseType',
                name: 'baseType',
                component: () => import( '../views/goodsAndGifts/baseType/index.vue')
            },
            {
                path: '/baseBrand',
                name: 'baseBrand',
                component: () => import( '../views/goodsAndGifts/baseBrand/index.vue')
            },
            {
                path: '/gifts',
                name: 'gifts',
                component: () => import( '../views/goodsAndGifts/gifts/index.vue')
            },
            {
                path: '/giftsToGoods',
                name: 'giftsToGoods',
                component: () => import( '../views/goodsAndGifts/giftsToGoods/index.vue')
            },
            {
                path: '/giftsToGoodsInfo',
                name: 'giftsToGoodsInfo',
                component: () => import( '../views/goodsAndGifts/giftsToGoodsInfo/index.vue')
            },
            {
                path: '/activity',
                name: 'activity',
                component: () => import( '../views/goodsAndGifts/activity/index.vue')
            },
            {
                path: '/activityInfo',
                name: 'activityInfo',
                component: () => import( '../views/goodsAndGifts/activityInfo/index.vue')
            },
            {
                path: '/goodsAdjust',
                name: 'goodsAdjust',
                component: () => import( '../views/goodsAndGifts/goodsAdjust/index.vue')
            },
            {
                path: '/goodsAdjustInfo',
                name: 'goodsAdjustInfo',
                component: () => import( '../views/goodsAndGifts/goodsAdjustInfo/index.vue')
            },


            //售后管理模块
            {
                path: '/afout',
                name: 'Afout',
                component: () => import( '../views/aftersale/afout/index.vue')
            },
            {
                path: '/afoutsh',
                name: 'Afoutsh',
                component: () => import( '../views/aftersale/afoutsh/index.vue')
            },
            {
                path: '/afenter',
                name: 'Afenter',
                component: () => import( '../views/aftersale/afenter/index.vue')
            },
            {
                path: '/afentersh',
                name: 'Afentersh',
                component: () => import( '../views/aftersale/afentersh/index.vue')
            },
            {
                path: '/afchange',
                name: 'Afchange',
                component: () => import( '../views/aftersale/afchange/index.vue')
            },
            {
                path: '/afchangesh',
                name: 'Afchangesh',
                component: () => import( '../views/aftersale/afchangesh/index.vue')
            },
            {
                path: '/afretreat',
                name: 'Afretreat',
                component: () => import( '../views/aftersale/afretreat/index.vue')
            },
            {
                path: '/afretreatsh',
                name: 'Afretreatsh',
                component: () => import( '../views/aftersale/afretreatsh/index.vue')
            },
            {
                path: '/afappeal',
                name: 'Afappeal',
                component: () => import( '../views/aftersale/afappeal/index.vue')
            },
            {
                path: '/afappealsh',
                name: 'Afappealsh',
                component: () => import( '../views/aftersale/afappealsh/index.vue')
            },
            {
                path: '/returnMarket',
                name: 'ReturnMarket',
                component: () => import( '../views/returnMarket/index.vue')
            },
            {
                path: '/addIndent',
                name: 'AddIndent',
                component: () => import( '../views/addIndent/index.vue')
            }

        ]
    },
    {
        path: '/login',
        name: 'Login',
        component: LOGIN
    }

    /*
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/!* webpackChunkName: "about" *!/ '../views/About.vue')
  }*/
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
